<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8"/>
<meta name="description" content="这是一个 index 页面"/>
<meta name="keywords" content="index"/>
<title>登录界面</title>
<head th:include="amazeui/include :: header"></head>


<body data-type="login">
    <div class="am-g tpl-g">
        <!-- 风格切换 -->
        <div class="tpl-skiner">
            <div class="tpl-skiner-toggle am-icon-cog">
            </div>
            <div class="tpl-skiner-content">
                <div class="tpl-skiner-content-title">
                    选择主题
                </div>
                <div class="tpl-skiner-content-bar">
                    <span class="skiner-color skiner-white" data-color="theme-white"></span>
                    <span class="skiner-color skiner-black" data-color="theme-black"></span>
                </div>
            </div>
        </div>
        <div class="tpl-login">
            <div class="tpl-login-content">
                <div class="tpl-login-logo">

                </div>



                <form class="am-form tpl-form-line-form">
                    <div class="am-form-group">
                        <input type="text" class="tpl-form-input" id="username" placeholder="请输入账号">

                    </div>

                    <div class="am-form-group">
                        <input type="password" class="tpl-form-input" id="password" placeholder="请输入密码">

                    </div>
                    <div class="am-form-group tpl-login-remember-me">
                        <input id="remember-me" type="checkbox">
                        <label for="remember-me">
       
                        记住密码
                         </label>

                    </div>






                    <div class="am-form-group">

                        <button type="button" id = "submitLogin" class="am-btn am-btn-primary  am-btn-block tpl-btn-bg-color-success  tpl-login-btn">提交</button>

                    </div>
                </form>
            </div>
        </div>
    </div>
<div th:include="amazeui/include :: footer"></div>
<script src="/amazeui/assets/js/theme.js"></script>
<script type="text/javascript">
    $(document).ready(function () {

    	
    	$("#submitLogin").click(function(){
    		login();
    	});

    });

    function login() {
    	
    	var username = $("#username").val();
    	var password = $("#password").val();
    	var data ={username:username,password:password};
        $.ajax({
            type: "POST",
            url: "login",
            data: data,
            success: function (result) {
                if (result.success) {
                    parent.location.href = 'admin/index';
                } else {
                    alert(result.msg);
                }
            }
        });
    }


</script>
</body>

</html>